class Room < ActiveRecord::Base
  validates_uniqueness_of(:num)
  
  def self.find_empty_room(num_persons)
    roomtype = Roomtype.find_by_num_beds(num_persons)  
    if roomtype
      room = self.find(:first,:conditions => { :empty => true, :reserved => false})
    end
    room
  end  
  
end
